namespace MinimalApi
{
    public static class ProductMinimalApiExt
    {
        public static void ProductExtension(this WebApplication app)
        {
            app.MapGet("/QueryProduct", () =>
            {
                return new
                {
                    Id = 123,
                    Name = "张三",
                    Age = 35
                };
            })
            .WithName("QueryProduct")
            .WithTags("Product");  

            app.MapPost("/AddProduct", () =>
            {
                return new
                {
                    Success = true,
                    Message = "添加成功"
                };
            })
            .WithName("AddProduct")
            .WithTags("Product");  

            app.MapPut("/UpdateProduct", () =>
            {
                return new
                {
                    Success = true,
                    Message = "修改成功"
                };
            })
            .WithName("UpdateProduct")
            .WithTags("Product");  

            app.MapDelete("/DeleteProduct", () =>
            {
                return new
                {
                    Success = true,
                    Message = "删除成功"
                };
            })
            .WithName("DeleteProduct")
            .WithTags("Product");  
        }
    }
}
